//
//  IMLoginMessage.m
//  IMChezhil
//
//  Created by zhangliucheng on 15/7/3.
//  Copyright (c) 2015年 CheZhil. All rights reserved.
//

#import "IMLoginMessage.h"

@implementation IMLoginMessage

- (instancetype)initWithUin:(NSString *)uin token:(NSString *)token clientId:(NSString *)cId {
    self = [super init];
    if (self) {
        self.uin = uin;
        self.token = token;
        self.clientId = cId;
        self.clientType = @1;
    }
    return self;
}

- (NSData *)sendData {
    NSMutableDictionary *dict = [NSMutableDictionary new];
    [dict setObject:self.uin forKey:@"uin"];
    [dict setObject:self.token forKey:@"token"];
    [dict setObject:self.clientType forKey:@"clientType"];
    [dict setObject:self.clientId forKey:@"clientId"];
    NSData *contentData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:Nil];
    NSString *content = [[NSString alloc] initWithData:contentData encoding:NSUTF8StringEncoding];
    return [IMTool sendDataWithCode:CMD_USER_LOGIN content:content];
}

@end
